﻿#ifndef _LINK_H_
#define _LINK_H_


template <typename T>
class Node
{
public:
    Node(T t, Node* _next):value(t),next(_next){}
    Node()=default;

public:
    Node<T>* next;
    T value;

};

template <typename T>
class Link
{
public:
    typedef Node<T>* pointer;
    Link();
    ~Link();

    int size();
    bool isEmpty();

    pointer insert(int index, T t);
    pointer insert_head(T t);
    pointer insert_last(T t);

    pointer del(int index);
    pointer del_head();
    pointer del_last();

    T get(int index);
    T get_head();
    T get_last();

    pointer getHead();
    pointer getNode(int index);


protected:
    int count;
    pointer phead;
};

#include "Link.cpp"


#endif
